export function getFilename(response) {
  let contentDisposition = response.headers['Content-Disposition'] || response.headers['content-disposition']
  contentDisposition = decodeURIComponent(contentDisposition)
  if (contentDisposition) {
    return contentDisposition.split(';')[1].trim().split('=')[1]
  }
  return undefined
}

export function isJson(response) {
  return response.headers['content-type'].includes('application/json')
}
